package com.szh.cloud.common.entity;

import lombok.Data;

/**
 * API响应实体类
 */
@Data
public class AjaxEntity {
    private boolean success;  // 是否成功
    private String msg;       // 消息
    private String code;      // 状态码
    private Object data;      // 数据
    
    public AjaxEntity() {
        this.success = false;
        this.msg = "";
        this.code = "";
        this.data = null;
    }
    
    public AjaxEntity(boolean success, String msg) {
        this.success = success;
        this.msg = msg;
        this.code = "";
        this.data = null;
    }
    
    public AjaxEntity(boolean success, String msg, Object data) {
        this.success = success;
        this.msg = msg;
        this.code = "";
        this.data = data;
    }
    
    public AjaxEntity(boolean success, String msg, String code, Object data) {
        this.success = success;
        this.msg = msg;
        this.code = code;
        this.data = data;
    }
    
    public void setSuccess(boolean success) {
        this.success = success;
    }
    
    public boolean isSuccess() {
        return success;
    }
    
    public void setMsg(String msg) {
        this.msg = msg;
    }
    
    public String getMsg() {
        return msg;
    }
    
    public void setCode(String code) {
        this.code = code;
    }
    
    public String getCode() {
        return code;
    }
    
    public void setData(Object data) {
        this.data = data;
    }
    
    public Object getData() {
        return data;
    }
} 